package com.burstly.jackson.map.ser.std;

import com.burstly.jackson.JsonGenerationException;
import com.burstly.jackson.JsonGenerator;
import com.burstly.jackson.JsonNode;
import com.burstly.jackson.map.BeanProperty;
import com.burstly.jackson.map.JsonMappingException;
import com.burstly.jackson.map.JsonSerializer;
import com.burstly.jackson.map.ResolvableSerializer;
import com.burstly.jackson.map.SerializerProvider;
import com.burstly.jackson.map.TypeSerializer;
import com.burstly.jackson.map.annotate.JacksonStdImpl;
import java.io.IOException;
import java.util.List;

@JacksonStdImpl
public final class IndexedStringListSerializer extends StaticListSerializerBase<List<String>>
  implements ResolvableSerializer
{
  protected JsonSerializer<String> _serializer;

  public IndexedStringListSerializer(BeanProperty paramBeanProperty)
  {
    this(paramBeanProperty, null);
  }

  public IndexedStringListSerializer(BeanProperty paramBeanProperty, JsonSerializer<?> paramJsonSerializer)
  {
    super(List.class, paramBeanProperty);
    this._serializer = paramJsonSerializer;
  }

  private final void serializeContents(List<String> paramList, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider)
    throws IOException, JsonGenerationException
  {
    int i = 0;
    while (true)
    {
      int j;
      try
      {
        j = paramList.size();
        i = 0;
        break label65;
        String str = (String)paramList.get(i);
        if (str == null)
          paramSerializerProvider.defaultSerializeNull(paramJsonGenerator);
        else
          paramJsonGenerator.writeString(str);
      }
      catch (Exception localException)
      {
        wrapAndThrow(paramSerializerProvider, localException, paramList, i);
        return;
      }
      label65: 
      while (i >= j)
      {
        return;
        i++;
      }
    }
  }

  private final void serializeUsingCustom(List<String> paramList, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider)
    throws IOException, JsonGenerationException
  {
    int i = 0;
    while (true)
    {
      int j;
      try
      {
        j = paramList.size();
        JsonSerializer localJsonSerializer = this._serializer;
        i = 0;
        break label74;
        String str = (String)paramList.get(i);
        if (str == null)
          paramSerializerProvider.defaultSerializeNull(paramJsonGenerator);
        else
          localJsonSerializer.serialize(str, paramJsonGenerator, paramSerializerProvider);
      }
      catch (Exception localException)
      {
        wrapAndThrow(paramSerializerProvider, localException, paramList, i);
        return;
      }
      label74: 
      while (i >= j)
      {
        return;
        i++;
      }
    }
  }

  protected JsonNode contentSchema()
  {
    return createSchemaNode("string", true);
  }

  public void resolve(SerializerProvider paramSerializerProvider)
    throws JsonMappingException
  {
    if (this._serializer == null)
    {
      JsonSerializer localJsonSerializer = paramSerializerProvider.findValueSerializer(String.class, this._property);
      if (!isDefaultSerializer(localJsonSerializer))
        this._serializer = localJsonSerializer;
    }
  }

  public void serialize(List<String> paramList, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider)
    throws IOException, JsonGenerationException
  {
    paramJsonGenerator.writeStartArray();
    if (this._serializer == null)
      serializeContents(paramList, paramJsonGenerator, paramSerializerProvider);
    while (true)
    {
      paramJsonGenerator.writeEndArray();
      return;
      serializeUsingCustom(paramList, paramJsonGenerator, paramSerializerProvider);
    }
  }

  public void serializeWithType(List<String> paramList, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider, TypeSerializer paramTypeSerializer)
    throws IOException, JsonGenerationException
  {
    paramTypeSerializer.writeTypePrefixForArray(paramList, paramJsonGenerator);
    if (this._serializer == null)
      serializeContents(paramList, paramJsonGenerator, paramSerializerProvider);
    while (true)
    {
      paramTypeSerializer.writeTypeSuffixForArray(paramList, paramJsonGenerator);
      return;
      serializeUsingCustom(paramList, paramJsonGenerator, paramSerializerProvider);
    }
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.jackson.map.ser.std.IndexedStringListSerializer
 * JD-Core Version:    0.6.2
 */